package BinaryTree;

import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        //System.out.println(root.val);
        binaryTree.preOrder(root);
        System.out.println();
        System.out.println("====================");
        binaryTree.preorderNor(root);
        System.out.println();
        System.out.println("====================");
        binaryTree.inOrder(root);
        System.out.println();
        System.out.println("====================");
        binaryTree.postOrder(root);
        System.out.println();
        System.out.println("====================");
        List<BinaryTree.TreeNode> ret =binaryTree.preOrder2(root);
        for (BinaryTree.TreeNode i:ret){
            System.out.print(i.val+" ");
        }
        System.out.println();
        System.out.println("====================");
        List<BinaryTree.TreeNode> ret1 =binaryTree.inOrder2(root);
        for (BinaryTree.TreeNode i:ret1){
            System.out.print(i.val+" ");
        }
        System.out.println();
        System.out.println("====================");
        List<BinaryTree.TreeNode> ret2 =binaryTree.postOrder2(root);
        for (BinaryTree.TreeNode i:ret2){
            System.out.print(i.val+" ");
        }
        System.out.println();
        binaryTree.nodeSize(root);
        System.out.println(binaryTree.size);
        System.out.println();
        binaryTree.getTheLeafNodeSize(root);
        System.out.println(binaryTree.leafSize);
        System.out.println(binaryTree.getTheLeafNodeSize2(root));
        System.out.println(binaryTree.getKLevelNodeCount(root, 3));
        System.out.println(binaryTree.getHeight(root));
        boolean bret =binaryTree.find(root,'D');
        System.out.println(bret);
        binaryTree.levelOrder(root);
        boolean flag = binaryTree.isCompleteTree(root);
        System.out.println(flag);
    }
}
